With the development of various wireless communications technologies, by taking TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, time division-synchronous code division multiple access) as an example, the wireless communications technologies have a demand of time synchronization in addition to the demand of frequency synchronization.
An IEEE 1588V2 protocol is generally adopted at present to implement a function of time synchronization in a double-fiber line. The principle is that: transmission time information is acquired according to a time stamp generated when a 1588 clock synchronization packet is exchanged on the double-fiber line. Based on the precondition that forward path delay and reverse path delay are consistent, path delay and time offset are calculated according to the transmission time information and further clocks of a master device and a slave device are adjusted to implement time synchronization. However, because of a fiber cable production error or a fiber cable joint, the length of a forward optical fiber line and the length of a reverse optical fiber line are different, and the forward path delay is different from the reverse path delay, so that the time offset occurs. Therefore, the path delay of the double-fiber line needs to be compensated. Two compensation methods exist at present:
The first compensation method is that, lengths of a forward line and a reverse line between the master device and the slave device are measured through an OTDR (Optical Time Domain Reflectometer, optical time domain reflectometer) or other means, a delay error is calculated, and an actual time is compensated.
The second compensation method is that, test is performed between the master device and the slave device through a GPS (Global Positioning System, global positioning system), GPS standard time and time restored from a transmission line are compared, and the actual time is compensated according to a comparison result.
In sum, in the existing technology of implementing the time synchronization through compensation, node by node measurement is required during network planning and deployment, and a compensation value is set manually, so the planning and the deployment are complicated. When line topology changes, measurement needs to be performed again and the compensation value needs to be set again, so maintenance is rather complicated. When path delay between the devices is not fixed (for example, under a line protection function, the time offset is dynamically changed), the existing compensation scheme cannot solve the problem of time synchronization. In addition, when no GPS signal exists in a position where the device is located, a rubidium clock needs to be configured additionally to capture the GPS signal, and then measurement and compensation are performed, which is complicated to implement.